package com.ljx.recruit;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;

import java.io.IOException;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-06-02  22:50
 */
public class HttpUtil {


    public static Response doGet(String url){
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                .url(url)
                .build();
        try {
            return client.newCall(request).execute();
//            ResponseBody responseBody = response.body();

//            if (response.isSuccessful() && responseBody != null) {
//                String json = responseBody.string();
//
//                System.out.println(json.toString());
//            } else {
//                System.out.println("请求失败");
//            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

}
